import sqlite3

class DB():

	def __init__(self):
		self.con = sqlite3.connect("local.db")
		self.cur = self.con.cursor()

	def init_table(self):
		staff_sql = '''CREATE TABLE IF NOT EXISTS staff 
					(
						name varchar(16)
					);'''
		num_sql = '''CREATE TABLE IF NOT EXISTS numb
					(
						num int
					) ;'''
		zhiban_sql = '''CREATE TABLE IF NOT EXISTS zhiban
					(
						duty_date int,
						staffs varchar(128)
					);'''

		self.cur.execute(staff_sql)
		self.cur.execute(num_sql)
		self.cur.execute(zhiban_sql)
		self.con.commit()

	def init_data(self):
		staff_init = '''INSERT INTO staff VALUES 
					(
						
					);'''
		num_init = '''INSERT INTO numb VALUES
					(
						0
					) ;'''

		self.cur.execute(num_init)
		self.con.commit()

	def close_data(self):
		self.con.close()

